<template>
  <div>
    <el-button @click="change" type="primary">切换多语言</el-button>

    <div style="margin-top: 50px;">
      <el-pagination
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
        :current-page="currentPage4"
        :page-sizes="[100, 200, 300, 400]"
        :page-size="100"
        layout="total, sizes, prev, pager, next, jumper"
        :total="400"
      >
      </el-pagination>
    </div>

    <p>日历</p>
    <Calendar />

    <p>excel上传</p>
    <ExcelUpload />
  </div>
</template>

<script>
import Calendar from "@/components/Calendar.vue"
import ExcelUpload from "@/components/ExcelUpload.vue"
export default {
  name: "",
  data() {
    return {
      currentPage4: 4,
    }
  },
  methods: {
    change() {
      this.$confirm("您确定要切换多语言?", "提示", {
        confirmButtonText: this.$t("button.ok"),
        cancelButtonText: this.$t("button.cancel"),
        type: "warning",
      })
        .then(() => {
          let locale = this.$i18n.locale
          locale === "zh" ? (this.$i18n.locale = "en") : (this.$i18n.locale = "zh")
        })
        .catch(() => {})
    },
    handleSizeChange(val) {
      console.log(`每页 ${val} 条`)
    },
    handleCurrentChange(val) {
      console.log(`当前页: ${val}`)
    },
  },
  components: {
    Calendar,
    ExcelUpload,
  },
}
</script>
<style lang="less" scoped></style>
